<template>
  <div id="basic-layout">
    <a-layout style="min-height: 100vh">
      <a-layout-header class="header"><GlobalHeader /></a-layout-header>
      <a-layout>
        <a-layout-content class="content" :class="{ 'admin-content': isAdmin }">
          <router-view />
        </a-layout-content>
      </a-layout>
      <a-layout-footer class="footer"
        ><a href="https://gitee.com/dshadbao" target="_blank"
          >光点书集 By 豆沙包</a
        ></a-layout-footer
      >
    </a-layout>
  </div>
</template>

<script lang="ts" setup>
import GlobalHeader from '../components/GlobalHeader.vue'
</script>

<style lang="scss" scoped>
#basic-layout {
  .header {
    padding-inline: 20px;
    margin-bottom: 1px;
    color: unset;
    background: white;
  }

  .content {
    padding: 28px;
    transition: all 0.3s;

    // 管理员模式下内容区域全宽
    &.admin-content {
      margin-left: 0 !important;
    }
  }

  .footer {
    background: #efefef;
    text-align: center;
    padding: 16px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
  }

  .sider {
    background: #ffffff;
    border-right: 0.5px solid #eee;
    padding-top: 20px;
  }

  :deep(.ant-menu-root) {
    border-bottom: none;
    border-inline-end: none !important;
  }

  // 确保布局正确
  :deep(.ant-layout) {
    min-height: 100vh;

    .ant-layout-content {
      min-height: calc(100vh - 64px - 70px); // 减去header和footer高度
    }
  }
}
</style>
